<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Document</title>

  <style>

    .list {
      display: flex;

    }

    .item {
      display: flex;
    }
    
  </style>
</head>
<body>
  
  <div id="app">
      <h5>请选择你喜欢的专栏</h5>
    <div class="list">
      <div class="item" v-for="item in list">
        <input type="checkbox" v-model="item.isShow"></input>
        <p>{{item.value}}</p>
      </div>
    </div>
    <ul>
      <li v-for="item in selectList">
        {{item}}
      </li>
    </ul>
      
  </div>
  <script src="../vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        selectList: [],
        list : [
          {value:'科幻',isShow:false},
          {value:'喜剧',isShow:false},
          {value:'动漫',isShow:false},
          {value:'冒险',isShow:false},
          {value:'科技',isShow:false},
          {value:'军事',isShow:false},
          {value:'娱乐',isShow:false},
          {value:'奇闻',isShow:false},
        ]
      },
      methods: {
      
      },
      watch: {
          list : {
            deep:true,
            handler(newValue){
              // console.log(newValue)
              this.selectList = newValue.filter(item => item.isShow).map(item => item.value)
            }
          }
        }
    })

  </script>


</body>
</html>